<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改运营异常')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<style>
    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
        -webkit-appearance: none;
    }

    input[type="number"] {
        -moz-appearance: textfield;
    }
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-operate-edit">
        <input type="hidden" name="id" th:value="${operate.id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">工程公司：</label>
            <div class="col-sm-8">
                <select name="compName" class="form-control">
                    <option value="">请选择</option>
                    <option th:each="comp : ${comp}" th:text="${comp.compName}"
                            th:value="${comp.compName}" th:title="${comp.compId}"
                            th:selected="${comp.compName==operate.compName}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">项目名称：</label>
            <div class="col-sm-8">
                <select name="proName" class="form-control">
                    <option value="">请选择</option>
                    <option th:each="pro : ${pro}" th:text="${pro.proName}"
                            th:value="${pro.proName}" th:selected="${pro.proName==operate.proName}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">年份：</label>
            <div class="col-sm-8">
                <select name="years" class="form-control">
                    <option value="">请选择</option>
                    <option th:each="years : ${years}" th:text="${years.years}+'年'"
                            th:value="${years.years}" th:selected="${years.years==operate.years}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">月份：</label>
            <div class="col-sm-8">
                <select name="months" class="form-control">
                    <option value="">请选择</option>
                    <option th:each="months : ${months}" th:text="${months.monthInYear}+'月'"
                            th:value="${months.monthInYear}"
                            th:selected="${months.monthInYear==operate.months}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">类型：</label>
            <div class="col-sm-8">
                <select name="type" th:with="operateType=${@dict.getType('operateType')}" class="form-control">
                    <option th:each="operateType : ${operateType}" th:text="${operateType.dictLabel}"
                            th:value="${operateType.dictValue}"
                            th:selected="${operateType.dictValue==operate.type}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">风险等级：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="riskLevel" placeholder="请输入风险等级"
                       th:value="${operate.riskLevel}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">风险说明：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="riskExplain" placeholder="请输入风险说明"
                       th:value="${operate.riskExplain}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">风险措施：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="riskReason" placeholder="请输入风险措施"
                       th:value="${operate.riskReason}">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script>
    var prefix = ctx + "operate";

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-operate-edit").serializeArray();
            $.operate.save(prefix + "/edit", data);
        }
    }
</script>
</body>
</html>